<?php

namespace app\models;

use Yii;
use yii\base\Model;  //模型父类    yii\db\ActiveRecord 通常是普通模型类的父类但与数据表有关联  （译注：yii\db\ActiveRecord 类其实也是继承自 yii\base\Model，增加了数据库处理）

class EntryForm extends Model
{
    public $name;
    public $email;

    public function rules()
    {
        return [
            [['name', 'email'], 'required'],
            ['email', 'email'],
        ];
    }
}

?>